<ui:composition template="/main.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<ui:define name="content">
		<f:view locale="#{messageProvider.locale}">
			<h:form prependId="false">

				<p:confirmDialog global="true" showEffect="fade"
					hideEffect="explode">
					<p:commandButton value="#{webMsg['confirm.yes']}" type="button"
						styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
					<p:commandButton value="#{webMsg['confirm.no']}" type="button"
						styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
				</p:confirmDialog>

				<br />
				<br />
				<p:dataTable id="dataTable" var="log"
					value="#{sysLogBean.logDataModel}"
					selection="#{sysLogBean.selectedLogs}" paginator="true" rows="10"
					paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					lazy="true" rowsPerPageTemplate="5,10,15">
					<f:facet name="header">
						<table style="border:0">
						<tbody>
						<tr style="border:0">
							<td style="border:0" width="33%" align="left"><span style="border:0">
								<p:commandButton id="modalDialogButton" value="Filter"
										onclick="PF('filterDialog').show();" type="button" />
							</span></td>
							<td style="border:0"><span style="border:0"><h:outputText value="#{webMsg['log.list']}" /></span></td>
							<td style="border:0" width="33%" ><span style="border:0"></span></td>
						</tr>
						</tbody>
						</table>					

						
					</f:facet>
					<p:column selectionMode="multiple" style="width:2%" />
					<p:column width="60">
						<f:facet name="header">
							<h:outputText value="id" />
						</f:facet>
						<h:outputText value="#{log.id}" />
					</p:column>
					<p:column width="200" sortBy="userName">
						<f:facet name="header">
							<h:outputText value="#{webMsg['user.username']}" />
						</f:facet>
						<h:outputText value="#{log.userName}" />
					</p:column>

					<p:column>
						<f:facet name="header">
							<h:outputText value="#{webMsg['log.log']}" />
						</f:facet>
						<h:outputText value="#{log.log}" />
					</p:column>

					<p:column width="150" sortBy="createDate">
						<f:facet name="header">
							<h:outputText value="#{webMsg['createDate']}" />
						</f:facet>
						<h:outputText value="#{log.createDate}" />
					</p:column>

					<p:column width="60">
						<f:facet name="header">
							<h:outputText value="#{webMsg['delete']}" />
						</f:facet>
						<h:commandButton action='#{sysLogBean.deleteSingle}'
							value="#{webMsg['delete']}">
							<f:setPropertyActionListener target="#{sysLogBean.log}"
								value="#{log}" />
						</h:commandButton>

					</p:column>
				</p:dataTable>
				<p:dialog id="modalDialog" header="Filter Dialog"
					widgetVar="filterDialog" height="100">
					<h:outputText value="#{webMsg['user.username']}"></h:outputText>
					<h:inputText value="#{sysLogBean.userFilter.value}" />
					<p:commandButton action='#{sysLogBean.query}'
						update=":contentPanel" value="#{webMsg['query']}">
					</p:commandButton>
				</p:dialog>

			</h:form>

		</f:view>
	</ui:define>
</ui:composition>